import java.util.Scanner;

public class HJ60 {
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        while(sc.hasNext()){
            int number=sc.nextInt();
            int res[]=new int[2];
            for(int i=1;i<=number/2;i++){
                if(isPrime(i)&&isPrime(number-i)){
                    res[0]=i;
                    res[1]=number-i;
                }
            }
            System.out.println(res[0]);
            System.out.println(res[1]);

        }
    }

    public static boolean isPrime(int num){
        for(int i=2;i<num;i++){
            if(num%i==0){
                return false;
            }
        }
        return true;
    }
}
